﻿using System;
using System.Collections.Generic;


namespace JSONHelpers
{
    public class JSONArray : List<JSONObject>
    {
        public static readonly JSONArray Empty = new JSONArray();

        public JSONArray (params JSONObject [] objects)
        {
            AddRange (objects);
        }

        public override string ToString()
        {
            List<string> sobjects = new List<string>();

            foreach (JSONObject @object in this)
                sobjects.Add(@object.ToString());

            return "[" + string.Join(",", sobjects.ToArray()) + "]";
        }
    }
}
